const {
  Sequelize,
  Model
} = require('sequelize')
const {
  sequelize
} = require('../config/db');

// 定义模型
class video extends Model {

}

video.init({
  id: {
    type: Sequelize.INTEGER,
    primaryKey: true,
    autoIncrement: true
  },
  title: {
    type: Sequelize.STRING,
    allowNull: false,
    comment: '标题'
  },
  coverImage:{
    type: Sequelize.STRING,
    allowNull: true,
    comment: '封面图片'
  },
  author: {
    type: Sequelize.STRING,
    allowNull: true,
    comment: '作者'
  },
  url:{
    type: Sequelize.STRING,
    allowNull: true,
    comment: '内容'
  },
  status:{
    type: Sequelize.STRING,
    allowNull: true,
    comment: '状态'
  },
}, {
  sequelize,
  modelName: 'video',
  tableName: 'video'
})

// video.sync({
//   force: true
// })

module.exports = video